module StatsHelper
  
  # Returns the total number of collages found
  def stats_collages
    collages = 0
    @items.select{ |i| i.path =~ /news/}.each do |j|
      collages += j[:imagelist].size unless j[:imagelist].nil?
    end
    collages.to_s
  end

  # Returns the number of uniq persons found
  def stats_person
    uniq_persons().size
  end

  # Returns persons in an imagelist, possibly with duplicates name
  def person_nb_from_imagelist(il)
    n=Array.new
    il.each do |i|
      n << i[:name]
    end
    n
  end

end
